
<div  ng-controller="familyCtrl">
<div class="navbar navbar-fixed-top nav-brighter">
      <div class="navbar-inner">
        <div class="container-fluid">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#tabChat" data-toggle="tab"><img src="content/img/bar_logo_2.png"/></a>
          <div class="nav-collapse collapse">
            <p class="navbar-text pull-right">
              הינך מחובר כ<a href='#' class="nav-link">{{nickname}}</a>
			    <a href="saftalk/logout" class="btn btn-mini logout_button">התנתק</a>
            </p>
            <ul class="nav">
              <li class="active"><a href="#tabChat" id="home_link" data-toggle="tab">בית (צ'אט)</a></li>
              <li><a href="#tabPictures" data-toggle="tab" ng-click="loadGallery()">תמונות</a></li>
              <!--<li><a href="#tabVideo" data-toggle="tab">וידאו</a></li>-->
              <!--<li><a href="#tabSettings" data-toggle="tab">הגדרות</a></li>-->
              <li ng-show="isAdmin"><a href="#tabUsers" data-toggle="tab" ng-click="loadUsers()">ניהול משתמשים</a></li>
            </ul>
          </div>
        </div>
      </div>
    </div>

<div class="container-fluid mainFamily" >
    <div class="row-fluid">

        <div class="tab-content span9">
            <div class="tab-pane active" id="tabChat">
                <div class="pnlChat">
            
                    
                        <div class="chatArea chatAreaRegular">
							<div id="scrollChat">
								<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
								<div class="viewport">
									 <div class="overview">
												<div class="history" ng-include src="'content/html/chatArea-tpl.html?v2.492'" scope="this"></div>

									</div>
								</div>
							</div>	
						</div>
							<div clas="formAreaWrap">
                            <div class="formArea">
							<div id="flipbox">
							
							  <div class="sendMessage in" ng-class="{'fade hide':currentMsgFrom!='sendMessage'}">
                                <form ng-submit="publish()" >
                                
                                    <div class="inputSubmitArea">
                                        <input type="submit" class="btn btn-primary  btnSend" value="שלח&raquo;">
                                    </div>
                                    <div class="inputFields">
                                        <input id="chat-input" type="text" name="text" ng-model="message.text" placeholder="מה תרצו לכתוב ?" autocomplete="off" />
                                    </div>
                                </form>
							 </div>
							 
							  <div class="sendImage in" ng-class="{'fade hide':currentMsgFrom!='sendImage'}">
                               	<form  id="image-upload-form" class="row-fluid" method="post" enctype="multipart/form-data" accept-charset="UTF-8" >  
                                    <div class="inputSubmitArea">
                                        <input type="submit" id="image-form-submit"  class="btn btn-primary  btnSend" value="שלח&raquo;">
                                    </div>
                                    <div class="inputFields fileDescriptionFi" >
										<div class="row-fluid">
										<div class="span8">
											<input type="hidden" name="channel" value="{{channel}}">
											<input type="text" name="description" ng-model="description" placeholder="מה בתמונה?" autocomplete="off" >							 			
										</div>	
										<div class="span3">
											<div id="image-upload-file-container" class="file-container"> 
												<input id="image-upload-file" type="file" name="file">
												<div id="image-upload-file-text" class="placeholder">בחר קובץ...</div>
											</div>
										</div>
									</div>
										
                                    </div>
                                </form>
							 </div>
							 
							  <div class="sendSurvey in" ng-class="{'fade hide':currentMsgFrom!='sendSurvey'}">
                              
                                
                                    <div class="inputSubmitArea">
									 
                                        <input ng-click="sendSurvey()" type="submit" class="btn btn-primary  btnSend" value="שלח&raquo;">
										
										
                                    </div>
                                    <div class="inputFields">
										<div>
										 <form ng-submit="sendSurvey()">
										 <input type="text" name="text" ng-model="survey.question" placeholder="מה תרצו לשאול?" autocomplete="off" > <br>	
										 </form>
										 </div>
									 	<div class="answers newFormLine">
											  <form  ng-submit="addSurveyAnswer()">
											 <input type="text" placeholder="כתבו כאן אופציות לתשובה" autocomplete="off"  ng-model="newSurveyAnsewr">
											 <img class="btnPlus" src="/content/img/glyphicons_190_circle_plus.png" ng-click="addSurveyAnswer()"/>
									
											</form>
											 <div class="">
												<span class="label label-success" ng-repeat="answer in survey.answers" class="label">
													  <button type="button" class="close" ng-click="removeSurveyAnswer($index)">&times;</button>
													  {{answer}}
												</span>
											</div>	
											
											</div>
											
										</div>
								
                              
							 </div>
						
							
							</div>
							</div>
	
                              <div class="chatActionsBtnHolder">
								<div ng-class="{'activeButton':currentMsgFrom=='sendMessage'}">
                                <span ng-click="flip('sendMessage')" title="שלח הודעה" class="btnMessage" ></span>
								</div>
								<div ng-class="{'activeButton':currentMsgFrom=='sendImage'}">
                                <span ng-click="initImageForm()" title="שלח תמונה" class="btnSendImg" > </span>
								</div>
								<div ng-class="{'activeButton':currentMsgFrom=='sendSurvey'}">
                                <span ng-click="flip('sendSurvey')" title="שלח סקר" class="btnSurvey" > </span>
								</div>
                            </div>
	
					</div>
					</div>
		

            </div>
            <div class="tab-pane" id="tabPictures">
					<div id="tabPictures" class="">
					
						<div id="photoGallery">
							
						</div>
					</div>
            </div>
        
            <div class="tab-pane" id="tabSettings">
                <p>Here will be Settings</p>
            </div>
            <div class="tab-pane" id="tabUsers">
            	
            	<div class="user-management">
            		<div class="row-fluid">
            			<div class="span4">
            				<div class=" managed-user admin-user">
            					<div class="user-role">מנהל</div>
            					<div class="user-info">
                    				<a ng-click="popupProfileImageUpload(userManagement.adminUser)"><img ng-src="{{userManagement.adminUser.getImageUrl()}}" height="45" width="45" class="profile-img"/></a>
                    			<ul>
            	        			<li><b>שם : </b>{{userManagement.adminUser.name}}</li>    	                			                    			
                    			</ul>
                    			<div class="btn-group">
    								<span class="btn btn-primary btn-small" ng-click="popupUserEdit(userManagement.adminUser)">ערוך</span>
    							</div>
    							</div>  
									
            				</div>
						</div>
						<div class="span4">
            				<div class="managed-user senior-user">
            					<div class="user-role">מבוגר</div>
            					<div class="user-info">
                    				<a ng-click="popupProfileImageUpload(userManagement.seniorUser)"><img ng-src="{{userManagement.seniorUser.getImageUrl()}}" height="45" width="45" class="profile-img"/></a>
                    			<ul>
            	        			<li><b>שם : </b>{{userManagement.seniorUser.name}}</li>                    			
                    			</ul>
            	        		<div class="btn-group">
    								<span class="btn btn-primary btn-small" ng-click="popupUserEdit(userManagement.seniorUser)">ערוך</span>
            	        			<span class="btn btn-info btn-small" ng-click="popupSeniorSettings()">הגדרות</span>    								
    								<span class="btn btn-warning btn-small" ng-click="popupSeniorInstall()">הורד התקנה</span>
	    						</div>
	    						</div> 
                    		</div>	            		            		
            			</div>
            			<div class="span1">
            				
            			</div>

            		</div>
            		<div class="managed-users clearfix">
                	<ul >
                		<li class="managed-user" ng-repeat="user in userManagement.users" >
                			<div class="user-info">
                    			<a ng-click="popupProfileImageUpload(user)"><img ng-src="{{user.getImageUrl()}}" height="45" width="45" class="profile-img"/></a>
                    		 <ul>
                    			<li><b>שם : </b>{{user.name}}</li>
                    		</ul>
                    		<div class="btn-group">
    							<a class="btn btn-primary btn-small" ng-click="popupUserEdit(user)">ערוך</a>
    							<a class="btn btn-danger btn-small" ng-click="deleteUser(user)">מחק</a>
    						</div>    		      
    						</div>      		
                    	</li>	
                	</ul>
				
                	</div>
					<div class="addUserBtnDiv">
						<div class="btn btn-success" ng-click="popupUserAdd()">הוסף משתמש</div>
					</div>
                		
            	</div>
            </div>
        </div>

	
        <div class="tabbable span3 leftBar">
            <div class="grandmaStatus">
				<div class="singleUser">
                <img ng-src={{seniorUser.getImageUrl()}} />
				<div class="userName">{{seniorUser.name}}</div>
				</div>
                <div class="status">
                    <div>סטטוס: <span class="statusConnected">{{seniorUser.getStatus()}}</span></div>
                    <div class="btn btn-mini btn-success call-senior-button" ng-click="sendVideoChat(seniorUser.userId,seniorUser.name)" ng-show="seniorUser.isOnline">התקשר</div>
				
                </div>
				
            </div>

            <div class="usersStatus">
                <h7>משתמשים:</h7>
				<div class="userLists">
				
					<div class="singleUser" ng-repeat="user in onlineUsers.users| filter:userListFilter" cool-fade>
						<img ng-src= {{user.getImageUrl()}}  class="profile-img"/>
						<img ng-src={{user.getStatusCircle()}} class="statusCircle"/>
						
						<div class="userName">{{user.name}}</div>
						<div class="btn btn-mini btn-success call-user-button "  ng-click="sendVideoChat(user.userId,user.name)" ng-show="user.isOnline">התקשר</div>
					</div>
				
					<div class="noUsersMsg" ng-hide="isOnlineUsersFull()">
					אין משתמשים נוספים
					</div>
						<br class="clear"/>
				</div>
            </div>

        </div>
    </div>
</div>
<!--/row-->
</div>

		<div id="seniorKioskModal" class="seniorKioskModal">
			<div class="container-narrow">
				<h2 class="form-edit-heading">התקנת גרסת מבוגר</h2>
                <p>
                    עבור בן המשפחה המבוגר קיימת גרסה ייחודית של ממשק האפליקציה. ממשק זה הוא פשוט יותר מן הממשק הרגיל,
                    ומותאם במיוחד לאנשים מבוגרים עם קושי בשימוש בטכנולוגיה.
                </p>
                <p>
                    שימו לב  - ההתקנה תומכת במערכת ההפעלה של windows ודורשת שדפדפן Chrome יהיה מותקן במחשב.
                    כמו כן, על מנת שמצב המבוגר של Saftalk יעלה מיידית בעת עליית המחשב , מומלץ לבטל את מסך ההתחברות של Windows,
                    הסבר מפורט לכך ניתן למצוא במדריך
                    <a href="http://blogs.microsoft.co.il/blogs/support/archive/2011/12/13/956127.aspx" target="_blank">"כיצד נוכל להגדיר התחברות אוטומטית למערכת ההפעלה?"</a>
                    .
                </p>
				<p>
				להתקנת מצב המבוגר של Saftalk במחשב זה לחצו כאן:
				</p>
				<div>
					<a href="/install/get" class="btn btn-success">הורד תוכנה</a>
				</div>
				<p>
				 והריצו את הקובץ.
				</p>
				
			</div>
		</div>


		<div id="seniorSettingsPopUp" class="seniorSettingsModal" ng-controller="SeniorSettingsCtrl">
			<div class="container-narrow">
					<form class="form-signin">
        				<h2 class="form-edit-heading">הגדרות מבוגר</h2>
							<div id = "register">
								<span>מקלדת:</span>
							    <select name="keyboardEnabled" ng-model="keyboardEnabled">
							    	<option value="true">פעילה</option>
							    	<option value="false">נסתרת</option>
							    </select>
							    
								<div class="clearfix"></div>
								
								<span>גודל גופן:</span>
							    <select name="fontSize" ng-model="fontSize">
							    	<option value="0">קטן</option>
							    	<option value="1">בינוני</option>
							    	<option value="2">גדול</option>
							    </select>
							    
								<div class="clearfix"></div>	
								<button  type="submit" ng-click="saveSettings()" class="btn btn-success {{submitButton.disabled}}" disabled="{{submitButton.disabled}}">
								{{submitButton.label}}
								</button>
								<button class="btn " ng-click="cancelSettings()">ביטול</button>	
							</div>
					</form>
			</div>				
		</div>

		<div id="profileImagePopup" class="userEditModal">
			<div class="container-narrow">
					<form  id="profile-upload-form" method="post" enctype="multipart/form-data" accept-charset="UTF-8" >
							<input id="profile-upload-user" type="hidden" name="userId">
							<h2 class="form-edit-heading">החלף תמונת משתמש</h2>
							<div id="profile-upload-file-container" class="file-container">
								<input id="profile-upload-file" type="file" name="file">
								<div id="profile-upload-file-text" class="placeholder">בחר קובץ...</div>
	                        </div>   
							<div>
                            	<input type="submit" id="profile-upload-submit"  class="btn btn-success " value="שלח&raquo;">
                            </div>
                    </form>
              </div>      		
		</div>
		<div id="userEditPopUp" class="userEditModal" ng-controller="UserEditCtrl">
			<div class="container-narrow">
					<form class="form-signin">
        				<h2 class="form-edit-heading">{{userAction}} משתמש</h2>
							<div id = "register">
                				<span  ng-show="isEdit">שם:</span> <input placeholder="שם" type="text" name="name" ng-model="name"/>
								<div class="clearfix"></div>							
                				<span  ng-show="isEdit">כתובת:</span> <input placeholder="כתובת דואר" type="text" name="email" ng-model="email"/>
                				<div class="clearfix"></div>
								<span ng-show="password != null && isEdit">סיסמא ראשונית:</span> <input ng-show="password != null" type="text" name="password" ng-model="password" ng-change="changePassword=true"/>
                				<div class="clearfix"></div>
               					<span ng-show="isEdit">טלפון:</span> <input placeholder="טלפון" type="text" name="phoneNumber" ng-model="phoneNumber" ng-show="isEdit"/>
								<div class="clearfix"></div>
								<div class="register-alerts">
									<div class="alert alert-error hidden">
										חלה שגיאה!
									<br/>
									חובה למלא שם, כתובת אימייל וסיסמא
						
								</div>
							</div>

						<button  type="submit" ng-click="saveUser()" class="btn btn-success {{submitButton.disabled}}" disabled="{{submitButton.disabled}}">
							{{submitButton.label}}
						</button>
						<button class="btn " ng-click="cancelUser()">ביטול</button>
					</div>
      			</form>
			
		</div>
